/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.uccart_project.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


@Entity
@Table(name = "materia")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Materia.findAll", query = "SELECT m FROM Materia m"),
    @NamedQuery(name = "Materia.findByMateriaId", query = "SELECT m FROM Materia m WHERE m.materiaId = :materiaId"),
    @NamedQuery(name = "Materia.findByMateriaNombre", query = "SELECT m FROM Materia m WHERE m.materiaNombre = :materiaNombre"),
    @NamedQuery(name = "Materia.findByMateriaLab", query = "SELECT m FROM Materia m WHERE m.materiaLab = :materiaLab"),
    @NamedQuery(name = "Materia.findByMateriaCreditos", query = "SELECT m FROM Materia m WHERE m.materiaCreditos = :materiaCreditos"),
    @NamedQuery(name = "Materia.findByMateriaArea", query = "SELECT m FROM Materia m WHERE m.materiaArea = :materiaArea")})
public class Materia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "materia_id")
    private String materiaId;
    @Basic(optional = false)
    @Column(name = "materia_nombre")
    private String materiaNombre;
    @Column(name = "materia_lab")
    private Short materiaLab;
    @Basic(optional = false)
    @Column(name = "materia_creditos")
    private short materiaCreditos;
    @Basic(optional = false)
    @Column(name = "materia_area")
    private String materiaArea;
    @OneToMany(mappedBy = "reqMateria")
    private List<Requisito> requisitoList;
    @OneToMany(mappedBy = "reqRequisito")
    private List<Requisito> requisitoList1;
    @OneToMany(mappedBy = "cursoCodmateria")
    private List<Curso> cursoList;
    @OneToMany(mappedBy = "planMateria")
    private List<Plan> planList;

    public Materia() {
    }

    public Materia(String materiaId) {
        this.materiaId = materiaId;
    }

    public Materia(String materiaId, String materiaNombre, short materiaCreditos, String materiaArea) {
        this.materiaId = materiaId;
        this.materiaNombre = materiaNombre;
        this.materiaCreditos = materiaCreditos;
        this.materiaArea = materiaArea;
    }

    public String getMateriaId() {
        return materiaId;
    }

    public void setMateriaId(String materiaId) {
        this.materiaId = materiaId;
    }

    public String getMateriaNombre() {
        return materiaNombre;
    }

    public void setMateriaNombre(String materiaNombre) {
        this.materiaNombre = materiaNombre;
    }

    public Short getMateriaLab() {
        return materiaLab;
    }

    public void setMateriaLab(Short materiaLab) {
        this.materiaLab = materiaLab;
    }

    public short getMateriaCreditos() {
        return materiaCreditos;
    }

    public void setMateriaCreditos(short materiaCreditos) {
        this.materiaCreditos = materiaCreditos;
    }

    public String getMateriaArea() {
        return materiaArea;
    }

    public void setMateriaArea(String materiaArea) {
        this.materiaArea = materiaArea;
    }

    @XmlTransient
    public List<Requisito> getRequisitoList() {
        return requisitoList;
    }

    public void setRequisitoList(List<Requisito> requisitoList) {
        this.requisitoList = requisitoList;
    }

    @XmlTransient
    public List<Requisito> getRequisitoList1() {
        return requisitoList1;
    }

    public void setRequisitoList1(List<Requisito> requisitoList1) {
        this.requisitoList1 = requisitoList1;
    }

    @XmlTransient
    public List<Curso> getCursoList() {
        return cursoList;
    }

    public void setCursoList(List<Curso> cursoList) {
        this.cursoList = cursoList;
    }

    @XmlTransient
    public List<Plan> getPlanList() {
        return planList;
    }

    public void setPlanList(List<Plan> planList) {
        this.planList = planList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (materiaId != null ? materiaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Materia)) {
            return false;
        }
        Materia other = (Materia) object;
        if ((this.materiaId == null && other.materiaId != null) || (this.materiaId != null && !this.materiaId.equals(other.materiaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.uccart_project.model.Materia[ materiaId=" + materiaId + " ]";
    }
    
}
